<%@include file="/jsp/init.jspf" %>
<hunk:init autocompleter="true"/>
<layout:top menu="purchase"/>
<hunk:container>
    <hunk:validator form="purchaseForm">
        <hunk:form action="purchase?action=search" name="purchaseForm">
            <table class="hundred">
                <tr>
                    <td width="33%">
                        <hunk:autocompletor name="item"  query="SELECT_ITEM" container="NULL" label="Item"/>
                    </td>
                    <td>
                        <hunk:calendar name="startDate"  label="From"  container="NULL"/>
                    </td>
                    <td>
                        <hunk:calendar name="endDate" label="To" container="NULL"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" align="center">
                        <br>
                        <hunk:submit label="Search"/>
                        <hunk:button styleClass="button" label="Clear" onclick="window.location='${path}/purchase.do?action=clear&page=search'"/>
                        <hunk:button styleClass="button" label="Add" onclick="window.location='${path}/purchase.do?action=clear'"/>
                    </td>
                </tr>
            </table>
        </hunk:form>
    </hunk:validator>
</hunk:container>

<display:table name="purchaseList" list="${purchaseList}" id="purchase" class="display_table">
    <display:column property="date"/>
    <display:column property="item.description" title="Item"/>
    <display:column property="item.code" title="code"/>
    <display:column property="purchaseFrom" title="Purchase From"/>    
    <display:column property="quantity"/>
    <display:column title="Action">
        <a href="${path}/purchase.do?action=edit&id=${purchase.id}" title="Edit" class="edit icon">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
    </display:column>
</display:table>

<layout:bottom/>
